﻿using Prism.Regions;
using System;
using Wpf.Ui.Controls;

namespace NxChatQQ.Views
{
    /// <summary>
    /// SettingWindow.xaml 的交互逻辑
    /// </summary>
    public partial class SettingWindow : FluentWindow
    {
        private readonly IRegionManager _RegionManager;

        public SettingWindow(IRegionManager regionManager)
        {
            InitializeComponent();

            _RegionManager = regionManager;
            // 新开窗体要刷新视图
            RegionManager.SetRegionManager(this, regionManager);
            RegionManager.UpdateRegions();
        }

        protected override void OnClosed(EventArgs e)
        {
            base.OnClosed(e);

            _RegionManager.Regions.Remove("SettingContent");
        }
    }
}
